def add(a, b):
    return a + b

def subtract(a, b):
    return a - b

def multiply(a, b):
    return a * b

def divide(a, b):
    if b == 0:
        return "除数不能为零"
    return a / b

def main():
    print("欢迎使用三位数加减乘除计算器！")
    while True:
        try:
            num1 = float(input("请输入第一个三位数："))
            num2 = float(input("请输入第二个三位数："))
            if not (100 <= num1 <= 999 and 100 <= num2 <= 999):
                print("输入的数字不是三位数，请重新输入！")
                continue
            operation = input("请输入操作符（+、-、*、/）：")
            if operation == "+":
                print(f"{num1} + {num2} = {add(num1, num2)}")
            elif operation == "-":
                print(f"{num1} - {num2} = {subtract(num1, num2)}")
            elif operation == "*":
                print(f"{num1} * {num2} = {multiply(num1, num2)}")
            elif operation == "/":
                print(f"{num1} / {num2} = {divide(num1, num2)}")
            else:
                print("输入的操作符无效！")
        except ValueError:
            print("输入无效，请输入数字！")
        choice = input("是否继续计算？（输入'yes'继续，其他任意键退出）：")
        if choice.lower() != "yes":
            break
if __name__ == "__main__":
    main()